package com.example.demo.refactor.price;

import com.example.demo.refactor.Movie;

/**
 * @author dhc
 * @title: NewReleasePrice
 * @projectName demo
 * @description: TODO
 * @date 2020-10-09 11:51
 */
public class RegularPrice extends Price {
    @Override
   public int getPriceCode() {
        return Movie.REGULAR;
    }

    @Override
    public double getCharge(int dayRented) {
       double thisAmount = 2;
        if (dayRented > 2)
            thisAmount += (dayRented - 2) * 1.5;
        return thisAmount;
    }
}
